package hey.dylan.controller;

import hey.dylan.form.UserForm;
import hey.dylan.model.ResponseResult;
import hey.dylan.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class LoginController {

    @Autowired
    LoginService loginService;

    @PostMapping("/user/goLogin")
    public ResponseResult goLogin(@RequestBody UserForm userForm){

        ResponseResult returnObj = loginService.login(userForm);
        return returnObj;

    }

    @PostMapping("/user/goLogout")
    public ResponseResult goLogout(){
        return loginService.logout();
    }

}
